<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/lib/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/css/public.css" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">

        <fieldset class="table-search-fieldset">
            <legend>搜索信息</legend>
            <div style="margin: 10px 10px 10px 10px">
                <div class="layui-form layui-form-pane" action="">
                    <div class="layui-form-item">
						<div class="layui-inline">
						    <label class="layui-form-label">会议类型：</label>
						    <div class="layui-input-inline">
						       <select id=" ">
						         <option value=""></option>
						         <option value="0">1</option>
						         <option value="1">2</option>
						         <option value="2">3</option>
						         <option value="3">4</option>
						         <option value="4">5</option>
						       </select>
						    </div>
						</div>
                        <div class="layui-inline">
							
                            <label class="layui-form-label">会议名称：</label>
                            <div class="layui-input-inline">
                                <input type="text" id=" " autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">主持人：</label>
                            <div class="layui-input-inline">
                                <input type="text" id=" " autocomplete="off" class="layui-input">
                            </div>
                        </div>
						<div class="layui-inline">
						    <label class="layui-form-label">部门：</label>
						    <div class="layui-input-inline">
						        <input type="text" id=" " autocomplete="off" class="layui-input">
						    </div>
						</div>
						<div class="layui-inline">
						    <label class="layui-form-label">会议内容：</label>
						    <div class="layui-input-inline">
						        <input type="text" id=" " autocomplete="off" class="layui-input">
						    </div>
						</div>
						<div class="layui-inline">
						    <label class="layui-form-label">会议日期：</label>
						    <div class="layui-input-inline">
						        <input type="date" id=" " autocomplete="off" class="layui-input">
						    </div>
						</div>
						
                        <div class="layui-inline">
                            <button type="submit" class="layui-btn layui-btn-primary"  lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 检 索</button>
                        </div>
						<div class="layui-inline">
						    <button type="submit" class="layui-btn layui-btn-primary"  lay-submit lay-filter="data-search-btn"> 还 原 </button>
						</div>
                    </div>
                </div>
            </div>
        </fieldset>

        <script type="text/html" id="toolbarDemo">
            <div class="layui-btn-container">
				<button class="layui-btn layui-btn-sm layui-btn-normal data-delete-btn" lay-event="delete"> 刷新 </button>
            </div>
        </script>

        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>

        <script type="text/html" id="currentTableBar">
            <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">查看/编辑</a>
        </script>

    </div>
</div>
<script src="/static/lib/layui/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form', 'table'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table;
//初始化表格加载
        table.render({
            elem: '#currentTableId',
            url: '../../api/sys/emp/emp.json',
            toolbar: '#toolbarDemo',
            defaultToolbar: ['filter', 'exports', 'print',],
			response: {
			    statusCode: 200 //规定成功的状态码，默认：0
			    , countName: 'total' //规定数据总数的字段名称，默认：count
			},
            cols: [[
                {type: "checkbox", width: '4%'},
				{field: '', width: '18%', title: '会议名称'},
                {field: '', width: '18%', title: '会议类型'},
                {field: '', width: '30%', title: '会议时间'},
				{field: '', width:'10%', title: '应到人数'},
				{field: '', width:'10%', title: '实到人数'},
				{field: '', width: '10%', title: '未到人数'},
            ]],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 15,
            page: true,
            skin: 'row'
        });

        //执行搜索重载
        var active = {
            reloads: function () {
                console.log("执行重载");
                var name = $('#name');
                var name = $('#name');
				var name = $('#name');
				var name = $('#name');
				var name = $('#name');
				var name = $('#name');
				
                //执行重载
                tableId.reload({
                    page: {
                        curr: 1 //重新从第 1 页开始
                    }
                    , where: {
                        "name":name.val(),
                        "name":name.val(),
                        "name":name.val(),
                        "name":name.val(),
                        "name":name.val(),
                        "name":name.val(),
                    }
                }, 'data');
            },
			clearsheack:function(){
			    console.log("清空搜索框");
                var name = $('#name');
                var name = $('#name');
				var name = $('#name');
				var name = $('#name');
				var name = $('#name');
				var name = $('#name');
				
				name.val("");
				jobNumber.val("");
				
				tableId.reload({
				    page: {
				        curr: 1 //重新从第 1 页开始
				    }
				    , where: {
                        "name":name.val(),
                        "name":name.val(),
                        "name":name.val(),
                        "name":name.val(),
                        "name":name.val(),
                        "name":name.val(),
				    }
				}, 'data');
			}
        };

        /**
         * toolbar监听事件
         */
        table.on('toolbar(currentTableFilter)', function (obj) {
            if (obj.event === 'add') {  // 监听刷新操作
        //执行搜索重载
        var active = {
            reloads: function () {
                console.log("执行重载");
                var name = $('#name');
                var name = $('#name');
				var name = $('#name');
				var name = $('#name');
				var name = $('#name');
				var name = $('#name');

                //执行重载
                tableId.reload({
                    page: {
                        curr: 1 //重新从第 1 页开始
                    }
                    , where: {
                        username: username.val(),
                        mobile: mobile.val()
                    }
                }, 'data');
            }
        };
                $(window).on("resize", function () {
                    layer.full(index);
                });
            }
        });

        //监听表格复选框选择
        table.on('checkbox(currentTableFilter)', function (obj) {
            console.log(obj)
        });
        //加载自定义方法
        $('[data-type]').click(function () {
            var type = $(this).data('type');
            active[type].call(this)
        })

    });

</script>

</body>
</html>